//
//  ProvinceListData.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/11/13.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "ProvinceListData.h"

@implementation ProvinceListData

- (id)init
{
    self = [super init];
    
    if (self)
    {
        self.isChoose = NO;
        self.backgroundColor = UIColorHex(#ffffff);
    }
    
    return self;
}

- (id)copyWithZone:(NSZone *)zone
{
    ProvinceListData* copyData = [[ProvinceListData allocWithZone:zone] init];
    
    copyData.areaID = [self.areaID copy];
    copyData.parentID = [self.parentID copy];
    copyData.name = [self.name copy];
    copyData.type = [self.type copy];
    copyData.status = [self.status copy];
    copyData.isChoose = self.isChoose;
    copyData.backgroundColor = [self.backgroundColor copy];
    
    if (self.datas)
    {
        NSMutableArray *copyArr = [NSMutableArray array];
        
        NSInteger dataCount = self.datas.count;
        for (NSInteger index=0; index<dataCount; index++)
        {
            [copyArr addObject:[self.datas[index] copy]];
        }
        
        copyData.datas = copyArr;
    }
    
    return copyData;
}

/// 属性map
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper
{
    return @{
             @"areaID":@"area_id",
             @"parentID":@"parent_id",
             @"datas":@"cityList",
             };
}

/// 属性名 生成 class
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass
{
    return @{
             @"datas":[ProvinceListData class]
             };
}

@end
